Skip to content

feat(fleet-queue): second_pass packet kind + review payload block (#2310) - #9402

Merged
dezren39 merged 1 commit into
mainfrom
queue/15297-2310-second-pass
Nov 13, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/15297-2310-second-pass

Conversation

@dezren39

@dezren39 dezren39 commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

What

Implements #2310 (design #2025 §§5.1–5.2, 7.2; D2 ruled 2026-11-11): the second_pass packet kind and the review payload block in the repo-task/v1 validator (pkgs/fleet/crates/fleet-queue/src/validate.rs).

Changes

  • KINDS gains second_pass.
  • New dedupe family second-pass: repo-health:v1:second-pass:<repo>:<issue>:pass-<n> (DedupeMatch gains a pass field), cross-checked against payload.issue.number and payload.review.pass; it is the only family valid for kind second_pass. One live packet per (artifact, pass) by construction — a second commissioning collides on the key.
  • review_errors: the §5.2 review block is required for second_pass and shape-checked whenever a packet carries one (the §5.3 Stage B interim attaches it to small_fix). gap_list and verdict_note_url required; pass/pass_cap positive; pass > pass_cap rejected at enqueue — the termination cap is arithmetic, not reviewer restraint.

Acceptance mapping

  • ✅ validate accepts a well-formed second_pass packet; rejects missing gap_list, missing verdict_note_url, pass > pass_cap — unit tests second_pass_packet_validates, second_pass_rejects_missing_gap_list, second_pass_rejects_missing_verdict_note_url, second_pass_rejects_pass_above_cap, second_pass_requires_the_review_block.
  • ✅ Second enqueue for the same (issue, pass) collides on the dedupe key — the key is a pure function of (repo, issue, pass) and the broker's dedupe uniqueness does the rest; second_pass_dedupe_family_matches_issue_and_pass pins the parse + cross-checks + family/kind binding both ways.
  • ✅ Existing kinds validate exactly as before — full suite: cargo test -p fleet-queue --features queue-broker → 298 passed, 0 failed (the pre-existing corpus controls for every family are in that suite).
  • ✅ Outcomes superseded_by_second_pass / second_pass_complete: checked validate.rs, turso_queue.rs, queue_broker.rs — no result-outcome allowlist exists to recognise them in (the acceptance item was conditional on one existing); completion results are free-form today.

Mirrors outside this repo

The packet evidence named two laptop-local copies; both were updated in place with the same semantics: ~/fleet-brokers-src/crates/queue-broker/src/validate.rs (compiles: cargo check -p queue-broker) and ~/tools/repo-task-v1.schema.json (kind enum + review block shape; still valid JSON). Deploying the broker build that carries this validator is the usual broker release step, unchanged by this PR.

Queue task 15297.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

)

Implements design #2025 sections 5.1-5.2 and 7.2 (D2 ruled
2026-11-11) in the repo-task/v1 packet validator:

- KINDS gains second_pass.
- New dedupe family second-pass:
  repo-health:v1:second-pass:<repo>:<issue>:pass-<n>, cross-checked
  against payload.issue.number and payload.review.pass, and the
  only family valid for kind second_pass — one live packet per
  (artifact, pass) by construction, so a second commissioning
  collides on the key instead of double-commissioning.
- The review payload block (verdict, verdict_note_url, artifact,
  pass, pass_cap, gap_list, goal_context_refs, producer,
  route_floor) is required for second_pass and shape-checked
  whenever any packet carries one (the Stage B interim small_fix
  representation): gap_list and verdict_note_url are required,
  pass/pass_cap must be positive, and pass > pass_cap is rejected
  at enqueue — the termination cap is arithmetic, not restraint.
- Result outcomes: no result-outcome allowlist exists in the
  validator or the broker (checked validate.rs, turso_queue.rs,
  queue_broker.rs), so superseded_by_second_pass /
  second_pass_complete need no recognition change; the acceptance
  item was conditional on one existing.

Mirrored the same change into the two laptop-local copies the
packet evidence named (fleet-brokers-src validate.rs — compiles;
~/tools/repo-task-v1.schema.json kind enum + review block), which
deploy outside this repo.

Tests: cargo test -p fleet-queue --features queue-broker —
298 passed, 0 failed, including 6 new second_pass tests
(well-formed packet validates; missing gap_list, missing
verdict_note_url, pass > pass_cap, and missing review block all
rejected; dedupe family matches issue+pass and rejects the family
for other kinds).
@dezren39
dezren39 requested a review from a team as a code owner November 13, 2026 09:38
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-13T09:39:02.802884Z
We couldn’t complete this review. Comment @codex review to try again.
b1cfdca PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 459e73a9-b538-4c1f-8973-94d08d844de9
Commits

Reviewing files that changed from the base of the PR and between 0883002 and b1cfdca.

Files selected for processing: 1

  • pkgs/fleet/crates/fleet-queue/src/validate.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39

Copy link
Copy Markdown
Member Author

Shepherd verification (lane code-d, task 15297): independently re-verified before merging.

  • cargo test -p fleet-queue --features queue-broker --lib in the PR worktree: 298/298 pass, including all six new tests (second_pass_packet_validates, second_pass_rejects_missing_gap_list, second_pass_rejects_missing_verdict_note_url, second_pass_rejects_pass_above_cap, second_pass_requires_the_review_block, second_pass_dedupe_family_matches_issue_and_pass) and the full pre-existing packet-corpus regression in the same suite. (Note for future runners: the validate module is behind the queue-broker feature — without it the lib test binary silently contains no validate tests.)
  • Acceptance mapping in the PR body checks out against the diff: KINDS + second_pass, the §5.2 review block (required for the kind, shape-checked whenever carried), the second-pass dedupe family cross-checked against payload.issue.number and payload.review.pass.
  • Codex gate: review failed to run (account usage limits, notice on this PR); CodeRabbit rate-limited. No findings exist to disposition.
  • Outcomes (superseded_by_second_pass / second_pass_complete): this crate validates no result-outcome allowlist, so per review loop: add second_pass packet kind + review payload block to repo-task/v1 (design #2025 §5) #2310's conditional ("recognised in result validation if it validates outcomes") there is nothing to extend here.

— lane code-d worker, 2026-11-13

@dezren39
dezren39 merged commit 8661591 into main Nov 13, 2026
1 check passed
@dezren39
dezren39 deleted the queue/15297-2310-second-pass branch November 13, 2026 10:17
dezren39 added a commit that referenced this pull request Nov 16, 2026
#2314) (#10654)

Implements design #2025 §5.4 (D2 ruled 2026-11-11; schema landed via #2310/PR #9402).
Template carries the seven ordered fields plus pass-cap facts; worked example
renders the Stage A shadow second-pass verdict on PR #4175 (#2313 exit report).

Co-authored-by: repo-worker-tmp-code-b <fleet@developing.today>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant